

char my_host_byte_order;
char my_host_osbits;

short	plded_yc_keyId_field_no;//98.10.22
short	pld_yc_keyid_field_no;	//98.10.22
int	current_pld_num;	//98.10.22
struct pld_result_struct pld_info_buf[SAMPLE_MAX_PLD_NUM]; //98.10.22

class sql_sentence_buf_obj SQL_sentence;	//2000.05.02

int	current_yc_sample_num;//98.10.14
int	current_dd_sample_num;//98.10.14
//int     current_yx_sample_num;//98.10.14
int	run_tag;
time_t	last_sample_time;
int g_sample_interval;

int	real_yc_sample_table_num;
int	hist_yc_sample_table_num;
//int	real_yx_sample_table_num;
//int	hist_yx_sample_table_num;
int	hist_dd_sample_table_num;
int	yc_current_total_fields_num;
//int	yx_current_total_fields_num;
int	dd_current_total_fields_num;
class 	system_net_info  history_sample;
class   duplicat_info sample_dup_info;

struct	one_sybase_info	yc_rsam_table_info[REAL_SAM_TABLE_MAX_NUM];
struct	one_yc_real_commit_info *yc_rsam_value;
int 	yc_real_record_num;
struct	one_sybase_info	yc_hsam_table_info[HIST_SAM_TABLE_MAX_NUM];
//struct one_sybase_info yx_rsam_table_info[REAL_SAM_TABLE_MAX_NUM];
//struct one_sybase_info yx_hsam_table_info[HIST_SAM_TABLE_MAX_NUM];
struct	one_sybase_info	dd_hsam_table_info[HIST_SAM_TABLE_MAX_NUM];
struct	yc_sample_info	*yc_sam_field_info;
//struct	yx_sample_info	*yx_sam_field_info;
struct	dd_sample_info	*dd_sam_field_info;

// Added by ZJH in SZB 02.01.22 for 1 + N problem
// global var indicates the status of current machine (whether is front machine and whether is main or backup)
int     front_machine_status;
int     need_save_to_file;
int     commit_number;
char    sql_file_name[50];
// End of Added

class one_second_sample_class	one_secod_sample;	//2000.05.06


int read_yc_sample_define_table();
//int read_yx_sample_define_table();
int read_dd_sample_define_table();
int init_oracle(class system_net_info &sys_info,char *proc_name);
//int execute_yx_sample(time_t cur_t);
int execute_yc_sample(time_t cur_t);
int execute_dd_sample(time_t cur_t);
int execute_sql_sentence(char *sql_sentence);
int execute_sql_sentence6(char *sql_sentence);
int execute_sql_sentence8(char *sql_sentence);
int execute_sql_sentence9(char *sql_sentence);

int init_pld_info(); //98.10.22
int read_pld_info(); //98.10.22

// Added by ZJH in SZB 02.01.23 for 1 + N problem
int     save_sql_to_file(
        char    *sql_file_name,
        char    *sql_sentence);
// End of Added

YcChangeList g_YcChangeList;
YcSampleList g_YcSampleList;
SgTimeList g_SgTimeList;
YcChangeList g_YcRealCurveList;

int g_SgBeforeTime = 60;
int g_SgAfterTime = 120;

int g_RealCurveBeforeTime = 1800;


